import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Niveles here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Niveles extends Actor
{
    private GreenfootImage ima1;
    private GreenfootImage ima2;
    private GreenfootImage ima3;
    private GreenfootImage ima4;
    private GreenfootImage ima5;
    private GreenfootImage ima6;
    private int d;
    public Niveles()
    {
        ima1 = new GreenfootImage("status1.png");
        ima2 = new GreenfootImage("status2.png");
        ima3 = new GreenfootImage("status3.png");
        ima4 = new GreenfootImage("status4.png");
        ima5 = new GreenfootImage("status5.png");
        ima6 = new GreenfootImage("status6.png");       
        
    }
    
    public void act() 
    {
        cambia();
    }    
    
    public void cambia()
    {
        World mundo= getWorld();
        d=((Mundo)mundo).dameNivel();
        switch(d)
        {
            case 1:
                    setImage(ima1);
            break;
            
            case 2:
                    setImage(ima2);
            break;
            
            case 3:
                    setImage(ima3);
            break;
            
            case 4:
                    setImage(ima4);
            break;
            
            case 5:
                    setImage(ima5);
            break;
            
            case 6:
                    setImage(ima6);
            break;
            
        }
    }
}
